package com.yangit.temp.util.excel.easy.service.impl;

import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.yangit.temp.util.excel.easy.entity.StationData;
import com.yangit.temp.util.excel.easy.mapper.StationDataMapper;
import com.yangit.temp.util.excel.easy.service.IStationService;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;


@Slf4j
@Service
public class StationServiceImpl implements IStationService {

	@Autowired
	private StationDataMapper stationMapper;
	

	
	@Override
	public int add(StationData stationDate) {
		int count = stationMapper.add(stationDate);
		return count;
	}

	@Async("taskExecutor")
	public void addSome(StationData stationDate) {
		stationMapper.add(stationDate);

	}

	@Override
	public List<StationData> get(String id) {
		List<StationData> list = stationMapper.get(id);
		return list;
	}

	@Override
	public void truncate() {
		stationMapper.truncate();
	}

	@Override
	public int delete(String[] ids) {
		int count = stationMapper.delete(ids);
		return count;
	}

	@Override
	public int deleteAll() {
		int count = stationMapper.deleteAll();
		return count;
	}

	@Override
	public int getCount(JSONObject json) {
		int count = stationMapper.getCount(json);
		return count;
	}

}
